package com.fourhats.dao.impl;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.fourhats.dao.RoleDAO;
import com.fourhats.model.UserRoles;

public class RoleDAOImpl implements RoleDAO {

	@Autowired
	private SessionFactory sessionFactory;
	
	private Session getCurrentSession(){
		return sessionFactory.getCurrentSession();
	}
	
	@Override
	public UserRoles getRole(int id) {
		UserRoles userRole = (UserRoles)  getCurrentSession().load(UserRoles.class, id);
		return userRole;
	}

}
